#pragma once
#include "util.hpp"
#include "level.hpp"
#include <thread>
#include <memory>

namespace mylog{
    struct LogMsg{
        using ptr = std::shared_ptr<LogMsg>;
        time_t _time;           // 时间
        LogLevel::value _level; // 日志等级
        std::thread::id _tid;   // 线程id
        std::string _name;      // 日志器名
        std::string _file;      // 文件名
        size_t _line;           // 行号
        std::string _payload;   // 日志消息

        LogMsg(const std::string& name, LogLevel::value level, const std::string& file, size_t line, const std::string& payload):
         _name(name), _level(level), _file(file), _line(line), _payload(payload), _time(time(NULL)), _tid(std::this_thread::get_id()){
            //std::cout << "构造完毕" << std::endl;
        }
    };
}